#ifndef ELEMENT_H_
#define ELEMENT_H_

#include "../globalStatic.h"
#include "pthread.h"
#include <string.h>
#include <sstream>

/**
 * \class Element
 * \brief base class for objects used by the ModuleHandler class to store and share information between the server and modules
 *
 * The class provides methods and data members which are common
 * throughout all types of Elements (Control, StatusElement, or ControlElement).
 *
 * All methods within Element and it's derived classes are designed to be used internally.
 * If a module uses them, there is not provision to register these objects with ModuleHandler
 * and so the server cannot display them.
 */
class Element {
public:
	Element();
	virtual ~Element();

	/**
	 * \brief purely virtual method to get the type of Element
	 * \return an enumerated type unique to the Element
	 */
	virtual int getType() = 0;
	/**
	 * \brief get the description of the Element
	 * \return description of the Element
	 */
	std::string getDescription();
	/**
	 * \brief set the description of the Element
	 */
	void setDescription(std::string description);

protected:
	/**
	 * \breif internal locking mechanism to create thread safety
	 */
	pthread_rwlock_t lock;
	/**
	 * \brief container for the description
	 */
	std::string description;
};

#endif /* ELEMENT_H_ */
